<div class="spaced_box">
  <span class="label">First Name:</span>
  <%=h @user.fname %>
</div>

<div class="spaced_box">
  <span class="label">Last Name:</span>
  <%=h @user.lname %>
</div>

<div class="spaced_box">
  <span class="label">Email:</span>
  <%=h @user.email %>
</div>

<div class="spaced_box">
  <span class="label">Roles:</span>
  <%=h @user.roles.join(", ") %>
</div>

<div class="spaced_box">
  <span class="label">Default Mapping Type:</span>
  <%=h @user.default_mapping_type.nil? ? "" : @user.default_mapping_type.name %>
</div>

<div>
  <%= h(@user.fname || "User") %> has <%= pluralize @user.usernames.length, "username" %>.
</div>

<table id="usernames_list">
  <tr>
    <th>Username</th>
    <th>Authentication Service</th>
    <th></th>
  </tr>
  <% @user.usernames.each do |username| %>
    <tr>
      <td><%= h username.username %></td>
      <td><%= h username.authentication_type.name %></td>
      <td><%= link_to(username.password.blank? ? "Create Password" : "Change Password", change_password_path(username)) if username.authentication_type.name == "local" %></td>
    </tr>
  <% end %>
</table>

<%= link_to 'Edit', edit_user_path(@user) %> |
<%= link_to 'Back', users_path %>
